package com.example.hyg_veintype.activity.result.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.example.hyg_veintype.R;
import com.example.hyg_veintype.base.baseadapter.BaseHolder;
import com.example.hyg_veintype.base.baseadapter.BaseRecyclerAdapter;

import java.util.List;

/**
 * @author: yyw
 * time: 2021/1/13 15:27
 * desc:脉型简称列表适配器
 */
public class VeinTypeSimpleNameAdapter extends BaseRecyclerAdapter<String> {

    public VeinTypeSimpleNameAdapter(List<String> infos, Context context) {
        super(infos, context);
    }

    @Override
    public BaseHolder<String> getHolder(View v, int viewType) {
        return new MyHolder(v, context);
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.veintype_item_veintype_simplename;
    }

    class MyHolder extends BaseHolder<String> {
        TextView tvSimpleName;

        public MyHolder(View itemView, Context context) {
            super(itemView, context);
            tvSimpleName = itemView.findViewById(R.id.tv_simplename);
        }

        @Override
        public void setData(String data, int position) {
            tvSimpleName.setText(data);
        }
    }
}